package com.tmq.diancan.controller.bladesystem;

import com.tmq.diancan.entity.Dept;
import com.tmq.diancan.entity.Role;
import com.tmq.diancan.service.IDeptService;
import com.tmq.diancan.service.IRoleService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author tangmqb
 * @DATE 2020/1/7 17:08
 */
@RestController("/blade-system/sys")
@AllArgsConstructor
public class SysClientController {
    IDeptService deptService;
    IRoleService roleService;

    @GetMapping("/getDeptName")
    public String getDeptName(Integer id) {
        return deptService.getById(id).getDeptName();
    }

    @GetMapping("/getDept")
    public Dept getDept(Integer id) {
        return deptService.getById(id);
    }

    @GetMapping("/getRoleName")
    public String getRoleName(Integer id) {
        return roleService.getById(id).getRoleName();
    }

    @GetMapping("/getRoleAlias")
    public String getRoleAlias(Integer id) {
        return roleService.getById(id).getRoleAlias();
    }

    @GetMapping("/getRole")
    public Role getRole(Integer id) {
        return roleService.getById(id);
    }
}
